a=1
b=1000
d=100
f=10000000
g=0
h=0
while f>b:
    c=int(input("1，2"))
    if c==1:
        b=b+b/10
        b=b-b%1
        d=d-10
        g=g+1
        print(b,d)
    if c==2:
        e=int(input("1,2,3"))
        if e==1 and b>5 and d<90:
            b=b-5
            d=d+20
            h=h+1
            print(b,d)
        if e==2 and b>10 and d<70:
            b=b-10
            d=d+40
            h=h+1
            print(b,d)
        if e==3 and b>20 and d<30:
            b=b-20
            d=d+80
            h=h+1
            print(b,d)
    if d<0:
        b=b+f
        print("n")
        print(g,h)
if b>f and d==0:
    print("y")
    print(g,h,b)